from common.pyside2_table.col import ColItem
from view.common_fun import review_file_url

idrs_col_model_list = [
    # 总体信息
    ColItem(col_name="id", col_nickname="id", is_hide=True),  # id
    ColItem(col_name="channel", col_nickname="DRCS号"),
    ColItem(col_name="url", col_nickname="查看", widget_type="btn"),  # 打开网址
    ColItem(col_name="file_channel", col_nickname="传递单号"),
    ColItem(col_name="title", col_nickname="DRCS标题", is_edit=True),
    ColItem(col_name="sys_attachment", col_nickname="系统附件", is_edit=True),
    ColItem(col_name="comment", col_nickname="主审意见", is_edit=True),
    ColItem(col_name="assister", col_nickname="协审方", widget_type="cmb",
            col_value=["E", "QC", "QA", "QA,QC", "E,C"]),

    # doc 信息
    ColItem(col_name="doc_code", col_nickname="通信渠道", father_type="str"),
    ColItem(col_name="doc_rev", col_nickname="版本", father_type="dic"),
    ColItem(col_name="doc_title", col_nickname="文件标题", father_type="dic"),
]

drcs_col_model_list = [
    # 总体信息
    ColItem(col_name="id", col_nickname="id", is_hide=True),  # id
    ColItem(col_name="url", col_nickname="查看", widget_type="btn", col_width=50),  # 打开网址
    ColItem(col_name="channel", col_nickname="DRCS号", col_width=160),
    ColItem(col_name="file_channel", col_nickname="传递单号", col_width=300),
    ColItem(col_name="title", col_nickname="DRCS标题", is_edit=True, col_width=300),
    ColItem(col_name="sys_attachment", col_nickname="系统附件", is_edit=True, col_width=200),
    ColItem(col_name="comment", col_nickname="总体意见", is_edit=True, col_width=260),
    ColItem(col_name="checker", col_nickname="审查人", is_edit=True, col_width=150),
    ColItem(col_name="approver", col_nickname="批准人", is_edit=True, col_width=150),
    ColItem(col_name="cc", col_nickname="抄送", is_edit=True, col_width=170),
    # doc 信息
    ColItem(col_name="doc_code", col_nickname="文件编号", father_type="str", col_width=240),
    ColItem(col_name="doc_rev", col_nickname="版本", father_type="dic", col_width=40),
    ColItem(col_name="doc_title", col_nickname="文件标题", father_type="dic", col_width=300),
    # ColItem(col_name="doc_result", col_nickname="结论", widget_type="cmb", father_type="dic",
    #         col_value=["ACC", "AEN", "RFC"], col_width=80),
    # ColItem(col_name="doc_review", col_nickname="审查意见", father_type="dic", is_edit=True, col_width=160)
]

contract_col_model_list = [
    ColItem(col_name="id", col_nickname="id", is_hide=True, father_type="df"),
    ColItem(col_name="project", col_nickname="项目", father_type="df"),
    ColItem(col_name="code", col_nickname="合同号", father_type="df"),
    ColItem(col_name="title", col_nickname="合同名称", father_type="df"),
    ColItem(col_name="lot_code", col_nickname="采购包号", father_type="df"),
    ColItem(col_name="factory", col_nickname="制造厂", father_type="df"),
    ColItem(col_name="date_soc", col_nickname="签订日期", father_type="df"),
    ColItem(col_name="date_eoc", col_nickname="生效日期", father_type="df"),
    ColItem(col_name="channel_code", col_nickname="通道代码", father_type="df"),
    ColItem(col_name="author_code", col_nickname="作者代码", father_type="df"),
    ColItem(col_name="note", col_nickname="进展", is_edit=True, father_type="df"),
    ColItem(col_name="nas_path", col_nickname="网络文件", widget_type="btn", father_type="df"),
    ColItem(col_name="local_path", col_nickname="本地文件", widget_type="btn", father_type="df")
]

factory_col_model_list = [
    ColItem(col_name="id", col_nickname="id", is_hide=True, father_type="df"),

    ColItem(col_name="code", col_nickname="文件编码", father_type="df"),
    ColItem(col_name="rev", col_nickname="版本", father_type="df"),
    ColItem(col_name="title", col_nickname="标题", father_type="df"),
    ColItem(col_name="date_public", col_nickname="生效日期", father_type="df"),
    ColItem(col_name="newest", col_nickname="最新", father_type="df"),
    ColItem(col_name="channel", col_nickname="通信渠道", father_type="df"),
    ColItem(col_name="reviewed", col_nickname="审查", is_hide=True, father_type="df"),
    ColItem(col_name="reviewed_result", col_nickname="结论", father_type="df"),
    ColItem(col_name="drcs", col_nickname="审查单号", father_type="df"),
    ColItem(col_name="note", col_nickname="说明", father_type="df"),

    ColItem(col_name="web_view", col_nickname="详情", father_type="df",widget_type="btn", value_attr_name="once_id", col_fun=review_file_url),
    ColItem(col_name="once_id", col_nickname="once_id", is_hide=True, father_type="df")

    # Col(col_name="file_path", col_nickname="打开", col_fun=(btn_local_file, "打开"), df_col_name="file_name")
]

doc_e_col_model_list = [
    ColItem(col_name="id", col_nickname="id", is_hide=True, father_type="df"),
    ColItem(col_name="code", col_nickname="文件编码", father_type="df"),
    ColItem(col_name="rev", col_nickname="版本", father_type="df"),
    ColItem(col_name="title", col_nickname="标题", father_type="df"),
    ColItem(col_name="date_public", col_nickname="生效日期", father_type="df"),
    ColItem(col_name="newest", col_nickname="最新", father_type="df"),
    ColItem(col_name="channel", col_nickname="通信渠道", father_type="df"),
    ColItem(col_name="web_view", col_nickname="详情", father_type="df",widget_type="btn", value_attr_name="once_id", col_fun=review_file_url),
    ColItem(col_name="once_id", col_nickname="once_id", is_hide=True, father_type="df")
    # Col(col_name="file_path", col_nickname="打开", col_fun=(btn_local_file, "打开"), df_col_name="file_name")
]


fax_col_model_list = [
    ColItem(col_name="id", col_nickname="id", is_hide=True, father_type="df"),
    ColItem(col_name="channel", col_nickname="通信渠道", father_type="df"),
    ColItem(col_name="code", col_nickname="编码", father_type="df"),
    ColItem(col_name="fax_type", col_nickname="函件类型", father_type="df"),
    ColItem(col_name="title", col_nickname="标题", father_type="df"),
    ColItem(col_name="date_effect", col_nickname="生效日期", father_type="df"),

    ColItem(col_name="reply_fax", col_nickname="答复函", father_type="df"),
    ColItem(col_name="replied_fax", col_nickname="被答复函", father_type="df"),
    ColItem(col_name="invalid", col_nickname="作废", father_type="df"),
    ColItem(col_name="note", col_nickname="说明", father_type="df"),
    ColItem(col_name="web_view", col_nickname="详情", father_type="df",widget_type="btn", value_attr_name="once_id", col_fun=review_file_url),
    ColItem(col_name="once_id", col_nickname="once_id", is_hide=True, father_type="df")
    # Col(col_name="file_path", col_nickname="打开", col_fun=(btn_local_file, "打开"), df_col_name="file_name")
]

